\(\int \cot ^{\frac {7}{2}}(c+d x) (a+i a \tan (c+d x))^3 \, dx\) [730]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 26, antiderivative size = 106 \[ \int \cot ^{\frac {7}{2}}(c+d x) (a+i a \tan (c+d x))^3 \, dx=\frac {8 \sqrt [4]{-1} a^3 \text {arctanh}\left ((-1)^{3/4} \sqrt {\cot (c+d x)}\right )}{d}+\frac {8 a^3 \sqrt {\cot (c+d x)}}{d}-\frac {8 i a^3 \cot ^{\frac {3}{2}}(c+d x)}{5 d}-\frac {2 \cot ^{\frac {3}{2}}(c+d x) \left (i a^3+a^3 \cot (c+d x)\right )}{5 d} \]

[Out]

8*(-1)^(1/4)*a^3*arctanh((-1)^(3/4)*cot(d*x+c)^(1/2))/d-8/5*I*a^3*cot(d*x+c)^(3/2)/d-2/5*cot(d*x+c)^(3/2)*(I*a
^3+a^3*cot(d*x+c))/d+8*a^3*cot(d*x+c)^(1/2)/d

Rubi [A] (verified)

Time = 0.31 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3754, 3637, 3673, 3609, 3614, 214} \[ \int \cot ^{\frac {7}{2}}(c+d x) (a+i a \tan (c+d x))^3 \, dx=\frac {8 \sqrt [4]{-1} a^3 \text {arctanh}\left ((-1)^{3/4} \sqrt {\cot (c+d x)}\right )}{d}-\frac {8 i a^3 \cot ^{\frac {3}{2}}(c+d x)}{5 d}-\frac {2 \cot ^{\frac {3}{2}}(c+d x) \left (a^3 \cot (c+d x)+i a^3\right )}{5 d}+\frac {8 a^3 \sqrt {\cot (c+d x)}}{d} \]

[In]

Int[Cot[c + d*x]^(7/2)*(a + I*a*Tan[c + d*x])^3,x]

[Out]

(8*(-1)^(1/4)*a^3*ArcTanh[(-1)^(3/4)*Sqrt[Cot[c + d*x]]])/d + (8*a^3*Sqrt[Cot[c + d*x]])/d - (((8*I)/5)*a^3*Co
t[c + d*x]^(3/2))/d - (2*Cot[c + d*x]^(3/2)*(I*a^3 + a^3*Cot[c + d*x]))/(5*d)

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rule 3609

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[d*
((a + b*Tan[e + f*x])^m/(f*m)), x] + Int[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]

Rule 3614

Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/Sqrt[(b_.)*tan[(e_.) + (f_.)*(x_)]], x_Symbol] :> Dist[2*(c^2/f), S
ubst[Int[1/(b*c - d*x^2), x], x, Sqrt[b*Tan[e + f*x]]], x] /; FreeQ[{b, c, d, e, f}, x] && EqQ[c^2 + d^2, 0]

Rule 3637

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim
p[b^2*(a + b*Tan[e + f*x])^(m - 2)*((c + d*Tan[e + f*x])^(n + 1)/(d*f*(m + n - 1))), x] + Dist[a/(d*(m + n - 1
)), Int[(a + b*Tan[e + f*x])^(m - 2)*(c + d*Tan[e + f*x])^n*Simp[b*c*(m - 2) + a*d*(m + 2*n) + (a*c*(m - 2) +
b*d*(3*m + 2*n - 4))*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a
^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && IntegerQ[2*m] && GtQ[m, 1] && NeQ[m + n - 1, 0] && (IntegerQ[m] || Intege
rsQ[2*m, 2*n])

Rule 3673

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(
e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[B*d*((a + b*Tan[e + f*x])^(m + 1)/(b*f*(m + 1))), x] + Int[(a + b*Tan[e
 + f*x])^m*Simp[A*c - B*d + (B*c + A*d)*Tan[e + f*x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b
*c - a*d, 0] &&  !LeQ[m, -1]

Rule 3754

Int[(cot[(e_.) + (f_.)*(x_)]*(d_.))^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_.))^(p_.), x_Symbol] :> Dist
[d^(n*p), Int[(d*Cot[e + f*x])^(m - n*p)*(b + a*Cot[e + f*x]^n)^p, x], x] /; FreeQ[{a, b, d, e, f, m, n, p}, x
] &&  !IntegerQ[m] && IntegersQ[n, p]

Rubi steps \begin{align*} \text {integral}& = \int \sqrt {\cot (c+d x)} (i a+a \cot (c+d x))^3 \, dx \\ & = -\frac {2 \cot ^{\frac {3}{2}}(c+d x) \left (i a^3+a^3 \cot (c+d x)\right )}{5 d}-\frac {1}{5} (2 i a) \int \sqrt {\cot (c+d x)} (-4 i a-6 a \cot (c+d x)) (i a+a \cot (c+d x)) \, dx \\ & = -\frac {8 i a^3 \cot ^{\frac {3}{2}}(c+d x)}{5 d}-\frac {2 \cot ^{\frac {3}{2}}(c+d x) \left (i a^3+a^3 \cot (c+d x)\right )}{5 d}-\frac {1}{5} (2 i a) \int \sqrt {\cot (c+d x)} \left (10 a^2-10 i a^2 \cot (c+d x)\right ) \, dx \\ & = \frac {8 a^3 \sqrt {\cot (c+d x)}}{d}-\frac {8 i a^3 \cot ^{\frac {3}{2}}(c+d x)}{5 d}-\frac {2 \cot ^{\frac {3}{2}}(c+d x) \left (i a^3+a^3 \cot (c+d x)\right )}{5 d}-\frac {1}{5} (2 i a) \int \frac {10 i a^2+10 a^2 \cot (c+d x)}{\sqrt {\cot (c+d x)}} \, dx \\ & = \frac {8 a^3 \sqrt {\cot (c+d x)}}{d}-\frac {8 i a^3 \cot ^{\frac {3}{2}}(c+d x)}{5 d}-\frac {2 \cot ^{\frac {3}{2}}(c+d x) \left (i a^3+a^3 \cot (c+d x)\right )}{5 d}+\frac {\left (80 i a^5\right ) \text {Subst}\left (\int \frac {1}{-10 i a^2+10 a^2 x^2} \, dx,x,\sqrt {\cot (c+d x)}\right )}{d} \\ & = \frac {8 \sqrt [4]{-1} a^3 \text {arctanh}\left ((-1)^{3/4} \sqrt {\cot (c+d x)}\right )}{d}+\frac {8 a^3 \sqrt {\cot (c+d x)}}{d}-\frac {8 i a^3 \cot ^{\frac {3}{2}}(c+d x)}{5 d}-\frac {2 \cot ^{\frac {3}{2}}(c+d x) \left (i a^3+a^3 \cot (c+d x)\right )}{5 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.73 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.72 \[ \int \cot ^{\frac {7}{2}}(c+d x) (a+i a \tan (c+d x))^3 \, dx=\frac {2 a^3 \cot ^{\frac {5}{2}}(c+d x) \left (-1-5 i \tan (c+d x)+20 \tan ^2(c+d x)+20 (-1)^{3/4} \arctan \left ((-1)^{3/4} \sqrt {\tan (c+d x)}\right ) \tan ^{\frac {5}{2}}(c+d x)\right )}{5 d} \]

[In]

Integrate[Cot[c + d*x]^(7/2)*(a + I*a*Tan[c + d*x])^3,x]

[Out]

(2*a^3*Cot[c + d*x]^(5/2)*(-1 - (5*I)*Tan[c + d*x] + 20*Tan[c + d*x]^2 + 20*(-1)^(3/4)*ArcTan[(-1)^(3/4)*Sqrt[
Tan[c + d*x]]]*Tan[c + d*x]^(5/2)))/(5*d)

Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 210 vs. \(2 (88 ) = 176\).

Time = 2.09 (sec) , antiderivative size = 211, normalized size of antiderivative = 1.99

method result size
derivativedivides \(\frac {a^{3} \left (8 \left (\sqrt {\cot }\left (d x +c \right )\right )-\frac {2 \left (\cot ^{\frac {5}{2}}\left (d x +c \right )\right )}{5}-2 i \left (\cot ^{\frac {3}{2}}\left (d x +c \right )\right )-\sqrt {2}\, \left (\ln \left (\frac {1+\cot \left (d x +c \right )+\sqrt {2}\, \left (\sqrt {\cot }\left (d x +c \right )\right )}{1+\cot \left (d x +c \right )-\sqrt {2}\, \left (\sqrt {\cot }\left (d x +c \right )\right )}\right )+2 \arctan \left (1+\sqrt {2}\, \left (\sqrt {\cot }\left (d x +c \right )\right )\right )+2 \arctan \left (-1+\sqrt {2}\, \left (\sqrt {\cot }\left (d x +c \right )\right )\right )\right )+i \sqrt {2}\, \left (\ln \left (\frac {1+\cot \left (d x +c \right )-\sqrt {2}\, \left (\sqrt {\cot }\left (d x +c \right )\right )}{1+\cot \left (d x +c \right )+\sqrt {2}\, \left (\sqrt {\cot }\left (d x +c \right )\right )}\right )+2 \arctan \left (1+\sqrt {2}\, \left (\sqrt {\cot }\left (d x +c \right )\right )\right )+2 \arctan \left (-1+\sqrt {2}\, \left (\sqrt {\cot }\left (d x +c \right )\right )\right )\right )\right )}{d}\) \(211\)
default \(\frac {a^{3} \left (8 \left (\sqrt {\cot }\left (d x +c \right )\right )-\frac {2 \left (\cot ^{\frac {5}{2}}\left (d x +c \right )\right )}{5}-2 i \left (\cot ^{\frac {3}{2}}\left (d x +c \right )\right )-\sqrt {2}\, \left (\ln \left (\frac {1+\cot \left (d x +c \right )+\sqrt {2}\, \left (\sqrt {\cot }\left (d x +c \right )\right )}{1+\cot \left (d x +c \right )-\sqrt {2}\, \left (\sqrt {\cot }\left (d x +c \right )\right )}\right )+2 \arctan \left (1+\sqrt {2}\, \left (\sqrt {\cot }\left (d x +c \right )\right )\right )+2 \arctan \left (-1+\sqrt {2}\, \left (\sqrt {\cot }\left (d x +c \right )\right )\right )\right )+i \sqrt {2}\, \left (\ln \left (\frac {1+\cot \left (d x +c \right )-\sqrt {2}\, \left (\sqrt {\cot }\left (d x +c \right )\right )}{1+\cot \left (d x +c \right )+\sqrt {2}\, \left (\sqrt {\cot }\left (d x +c \right )\right )}\right )+2 \arctan \left (1+\sqrt {2}\, \left (\sqrt {\cot }\left (d x +c \right )\right )\right )+2 \arctan \left (-1+\sqrt {2}\, \left (\sqrt {\cot }\left (d x +c \right )\right )\right )\right )\right )}{d}\) \(211\)

[In]

int(cot(d*x+c)^(7/2)*(a+I*a*tan(d*x+c))^3,x,method=_RETURNVERBOSE)

[Out]

1/d*a^3*(8*cot(d*x+c)^(1/2)-2/5*cot(d*x+c)^(5/2)-2*I*cot(d*x+c)^(3/2)-2^(1/2)*(ln((1+cot(d*x+c)+2^(1/2)*cot(d*
x+c)^(1/2))/(1+cot(d*x+c)-2^(1/2)*cot(d*x+c)^(1/2)))+2*arctan(1+2^(1/2)*cot(d*x+c)^(1/2))+2*arctan(-1+2^(1/2)*
cot(d*x+c)^(1/2)))+I*2^(1/2)*(ln((1+cot(d*x+c)-2^(1/2)*cot(d*x+c)^(1/2))/(1+cot(d*x+c)+2^(1/2)*cot(d*x+c)^(1/2
)))+2*arctan(1+2^(1/2)*cot(d*x+c)^(1/2))+2*arctan(-1+2^(1/2)*cot(d*x+c)^(1/2))))

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 340 vs. \(2 (86) = 172\).

Time = 0.26 (sec) , antiderivative size = 340, normalized size of antiderivative = 3.21 \[ \int \cot ^{\frac {7}{2}}(c+d x) (a+i a \tan (c+d x))^3 \, dx=-\frac {5 \, \sqrt {\frac {64 i \, a^{6}}{d^{2}}} {\left (d e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \log \left (\frac {{\left (8 i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + \sqrt {\frac {64 i \, a^{6}}{d^{2}}} {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{4 \, a^{3}}\right ) - 5 \, \sqrt {\frac {64 i \, a^{6}}{d^{2}}} {\left (d e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \log \left (\frac {{\left (8 i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} - \sqrt {\frac {64 i \, a^{6}}{d^{2}}} {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{4 \, a^{3}}\right ) - 16 \, {\left (13 \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} - 19 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + 8 \, a^{3}\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}}}{20 \, {\left (d e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]

[In]

integrate(cot(d*x+c)^(7/2)*(a+I*a*tan(d*x+c))^3,x, algorithm="fricas")

[Out]

-1/20*(5*sqrt(64*I*a^6/d^2)*(d*e^(4*I*d*x + 4*I*c) - 2*d*e^(2*I*d*x + 2*I*c) + d)*log(1/4*(8*I*a^3*e^(2*I*d*x
+ 2*I*c) + sqrt(64*I*a^6/d^2)*(d*e^(2*I*d*x + 2*I*c) - d)*sqrt((I*e^(2*I*d*x + 2*I*c) + I)/(e^(2*I*d*x + 2*I*c
) - 1)))*e^(-2*I*d*x - 2*I*c)/a^3) - 5*sqrt(64*I*a^6/d^2)*(d*e^(4*I*d*x + 4*I*c) - 2*d*e^(2*I*d*x + 2*I*c) + d
)*log(1/4*(8*I*a^3*e^(2*I*d*x + 2*I*c) - sqrt(64*I*a^6/d^2)*(d*e^(2*I*d*x + 2*I*c) - d)*sqrt((I*e^(2*I*d*x + 2
*I*c) + I)/(e^(2*I*d*x + 2*I*c) - 1)))*e^(-2*I*d*x - 2*I*c)/a^3) - 16*(13*a^3*e^(4*I*d*x + 4*I*c) - 19*a^3*e^(
2*I*d*x + 2*I*c) + 8*a^3)*sqrt((I*e^(2*I*d*x + 2*I*c) + I)/(e^(2*I*d*x + 2*I*c) - 1)))/(d*e^(4*I*d*x + 4*I*c)
- 2*d*e^(2*I*d*x + 2*I*c) + d)

Sympy [F(-1)]

Timed out. \[ \int \cot ^{\frac {7}{2}}(c+d x) (a+i a \tan (c+d x))^3 \, dx=\text {Timed out} \]

[In]

integrate(cot(d*x+c)**(7/2)*(a+I*a*tan(d*x+c))**3,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 158, normalized size of antiderivative = 1.49 \[ \int \cot ^{\frac {7}{2}}(c+d x) (a+i a \tan (c+d x))^3 \, dx=\frac {5 \, {\left (\left (2 i - 2\right ) \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} + \frac {2}{\sqrt {\tan \left (d x + c\right )}}\right )}\right ) + \left (2 i - 2\right ) \, \sqrt {2} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} - \frac {2}{\sqrt {\tan \left (d x + c\right )}}\right )}\right ) - \left (i + 1\right ) \, \sqrt {2} \log \left (\frac {\sqrt {2}}{\sqrt {\tan \left (d x + c\right )}} + \frac {1}{\tan \left (d x + c\right )} + 1\right ) + \left (i + 1\right ) \, \sqrt {2} \log \left (-\frac {\sqrt {2}}{\sqrt {\tan \left (d x + c\right )}} + \frac {1}{\tan \left (d x + c\right )} + 1\right )\right )} a^{3} + \frac {40 \, a^{3}}{\sqrt {\tan \left (d x + c\right )}} - \frac {10 i \, a^{3}}{\tan \left (d x + c\right )^{\frac {3}{2}}} - \frac {2 \, a^{3}}{\tan \left (d x + c\right )^{\frac {5}{2}}}}{5 \, d} \]

[In]

integrate(cot(d*x+c)^(7/2)*(a+I*a*tan(d*x+c))^3,x, algorithm="maxima")

[Out]

1/5*(5*((2*I - 2)*sqrt(2)*arctan(1/2*sqrt(2)*(sqrt(2) + 2/sqrt(tan(d*x + c)))) + (2*I - 2)*sqrt(2)*arctan(-1/2
*sqrt(2)*(sqrt(2) - 2/sqrt(tan(d*x + c)))) - (I + 1)*sqrt(2)*log(sqrt(2)/sqrt(tan(d*x + c)) + 1/tan(d*x + c) +
 1) + (I + 1)*sqrt(2)*log(-sqrt(2)/sqrt(tan(d*x + c)) + 1/tan(d*x + c) + 1))*a^3 + 40*a^3/sqrt(tan(d*x + c)) -
 10*I*a^3/tan(d*x + c)^(3/2) - 2*a^3/tan(d*x + c)^(5/2))/d

Giac [F]

\[ \int \cot ^{\frac {7}{2}}(c+d x) (a+i a \tan (c+d x))^3 \, dx=\int { {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{3} \cot \left (d x + c\right )^{\frac {7}{2}} \,d x } \]

[In]

integrate(cot(d*x+c)^(7/2)*(a+I*a*tan(d*x+c))^3,x, algorithm="giac")

[Out]

integrate((I*a*tan(d*x + c) + a)^3*cot(d*x + c)^(7/2), x)

Mupad [F(-1)]

Timed out. \[ \int \cot ^{\frac {7}{2}}(c+d x) (a+i a \tan (c+d x))^3 \, dx=\int {\mathrm {cot}\left (c+d\,x\right )}^{7/2}\,{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^3 \,d x \]

[In]

int(cot(c + d*x)^(7/2)*(a + a*tan(c + d*x)*1i)^3,x)

[Out]

int(cot(c + d*x)^(7/2)*(a + a*tan(c + d*x)*1i)^3, x)